package com.ruoyi.room.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.room.mapper.RoomRecordMapper;
import com.ruoyi.room.domain.RoomRecord;
import com.ruoyi.room.service.IRoomRecordService;

/**
 * 抽奖记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-08-14
 */
@Service
public class RoomRecordServiceImpl implements IRoomRecordService 
{
    @Autowired
    private RoomRecordMapper roomRecordMapper;

    /**
     * 查询抽奖记录
     * 
     * @param id 抽奖记录主键
     * @return 抽奖记录
     */
    @Override
    public RoomRecord selectRoomRecordById(Long id)
    {
        return roomRecordMapper.selectRoomRecordById(id);
    }

    /**
     * 查询抽奖记录列表
     * 
     * @param roomRecord 抽奖记录
     * @return 抽奖记录
     */
    @Override
    public List<RoomRecord> selectRoomRecordList(RoomRecord roomRecord)
    {
        return roomRecordMapper.selectRoomRecordList(roomRecord);
    }

    /**
     * 新增抽奖记录
     * 
     * @param roomRecord 抽奖记录
     * @return 结果
     */
    @Override
    public int insertRoomRecord(RoomRecord roomRecord)
    {
        roomRecord.setCreateTime(DateUtils.getNowDate());
        return roomRecordMapper.insertRoomRecord(roomRecord);
    }

    /**
     * 修改抽奖记录
     * 
     * @param roomRecord 抽奖记录
     * @return 结果
     */
    @Override
    public int updateRoomRecord(RoomRecord roomRecord)
    {
        return roomRecordMapper.updateRoomRecord(roomRecord);
    }

    /**
     * 批量删除抽奖记录
     * 
     * @param ids 需要删除的抽奖记录主键
     * @return 结果
     */
    @Override
    public int deleteRoomRecordByIds(Long[] ids)
    {
        return roomRecordMapper.deleteRoomRecordByIds(ids);
    }

    /**
     * 删除抽奖记录信息
     * 
     * @param id 抽奖记录主键
     * @return 结果
     */
    @Override
    public int deleteRoomRecordById(Long id)
    {
        return roomRecordMapper.deleteRoomRecordById(id);
    }
}
